/**
 * Created by xnr on 20/2/24.
 */

import request from '../utils/fetch'
//发送验证码
export function getCode(data) {
    return request({
        url: '/api/customer/send/code',
        method: 'get',
        loading: true,
        params: data
    })
}
//校验验证码
export function checkCode(data) {
    return request({
        url: '/api/customer/check/code',
        method: 'get',
        loading: true,
        params: data
    })
}
//登录
export function login(data) {
    return request({
        url: '/api/customer/login',
        method: 'post',
        loading: true,
        data: data
    })
}
//注册
export function reg(data) {
    return request({
        url: '/api/customer/register',
        method: 'post',
        loading: true,
        data: data
    })
}
//重置密码
export function resetPwd(data) {
    return request({
        url: '/api/customer/reset/pw',
        method: 'post',
        loading: true,
        data: data
    })
}
//修改密码
export function updatePwd(data) {
    return request({
        url: '/api/customer/update/password',
        method: 'post',
        loading: true,
        data: data
    })
}
//退出登录
export function logout() {
    return request({
        url: '/api/customer/logout',
        method: 'post',
        loading: true,
    })
}
//个人资料
export function personalInfo() {
    return request({
        url: '/api/customer/info',
        method: 'get',
        loading: false,
    })
}
//修改地址
export function updateAddress(data) {
    return request({
        url: '/api/customer/update/address',
        method: 'post',
        loading: true,
        data: data
    })
}
//修改头像
export function updateHead(data) {
    return request({
        url: '/api/customer/update/face',
        method: 'post',
        loading: true,
        data: data
    })
}
//帮助文档
export function listHelp(data) {
    return request({
        url: '/api/article/list/help',
        method: 'get',
        loading: true,
        params: data
    })
}
//关于我们&用户协议
export function aboutInfo(data) {
    return request({
        url: '/api/article/info',
        method: 'get',
        params: data,
        loading: true,
    })
}

//意见反馈--数据
export function tagList() {
    return request({
        url: '/api/feedback/tag/list',
        method: 'get',
        loading: true,
    })
}

export function addTagList(data) {
    return request({
        url: '/api/feedback/add',
        method: 'post',
        loading: true,
        data: data
    })
}

//实名认证--确认认证
export function certification(data) {
    return request({
        url: '/api/customer/certification',
        method: 'post',
        requestBody: 'body',
        loading: false,
        data: data
    })
}
//实名认证详情
export function certificationInfo(data) {
    return request({
        url: '/api/customer/certification/info',
        method: 'get',
        loading: false,
    })
}

//获取消息数
export function msgCount(data) {
    return request({
        url: '/api/msg/unread/num',
        method: 'get',
        loading: false,
    })
}

//修改工作状态isOpen: 0，关闭，1 ，打开
export function workStatus(data) {
    return request({
        url: '/api/worker/work/status',
        method: 'post',
        loading: false,
        data: data
    })
}

//工人获取地图项目数据
export function rangeCustomer(data) {
    return request({
        url: '/api/foreman/range/customer/list',
        method: 'get',
        loading: false,
        params: data
    })
}
//工头获取地图用户数据
export function rangeProject(data) {
    return request({
        url: '/api/worker/range/project/list',
        method: 'get',
        loading: false,
        params: data
    })
}

//查询当前用户的分享列表
export function shareList(data) {
    return request({
        url: '/api/customer/share/list',
        method: 'get',
        loading: false,
        params: data
    })
}